package nowcoder.huawei;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.util.Scanner;

/**
 * @author wuguojian
 * @description
 * https://www.nowcoder.com/practice/a35ce98431874e3a820dbe4b2d0508b1
 **/
public class HJ2 {
    public static void main(String[] args) throws FileNotFoundException {
        Scanner in = new Scanner(new FileReader("input/nowcoder_huawei/HJ2.txt"));
//        Scanner in = new Scanner(System.in);
        while (in.hasNext()) {
            char[] chars = in.nextLine().toLowerCase().toCharArray();
            String k = in.next().toLowerCase();
            int count = 0;
            for (char c : chars) {
                if(k.equals(String.valueOf(c))){
                    count++;
                }
            }
            System.out.println(count);
        }
    }
}
